package com.jewelry.crm.model.bo;

import com.jewelry.crm.model.dao.Factory;
import com.jewelry.crm.model.domain.User;
import java.util.Collection;


public class UserBo {

    public static void addUser(User user) throws Throwable {
        Factory.getInstance().getUserDao().addUser(user);
    }

    public static User getUserById(Long id) throws Throwable {
        return Factory.getInstance().getUserDao().getUserById(id);
    }

    public static User getUserById(int id) throws Throwable {
        return Factory.getInstance().getUserDao().getUserById((long) id);
    }

    public static Collection getAllUsers() throws Throwable {
        return Factory.getInstance().getUserDao().getAllUsers();
    }

    public static void deleteUser(User user) throws Throwable {
        Factory.getInstance().getUserDao().deleteUser(user);
    }

    public static void updateUser(User user) throws Throwable {
        Factory.getInstance().getUserDao().updateUser(user);
    }

}
